#==============================================================================
# EXTRACT VARIABLE IN A SPECIFIC LINE  [NOT FOR EXPORT]
#==============================================================================
ReadLine<-function(fs,ln) { 
	if (is.numeric(ln) == FALSE) return(NA)
	#fs --> file string containing entire parameter file
	#ln --> line number to read
	comchar <- "!" #indicate comments
	splchar <- "=" #sparate variable name and content
	vecchar <- "," #separate vector elements
	quochar <- "\"" #quote character
	
	line<-trim(fs[ln]) #assign line, but first remove leading/trailing blanks
	line<-unlist(strsplit(line,splchar, fixed = TRUE))
	varname<-line[1] #get variable name
	varvalu<-line[2] #get variable value
	varvalu<-unlist(strsplit(varvalu,comchar, fixed = TRUE))[1] #delete comment at end of line if one exists	
	varvalu<-unlist(strsplit(varvalu,vecchar, fixed = TRUE))    #separate vector elements
	varvalu<-gsub(quochar, "", varvalu)
	varvalu<-trim(varvalu) #remove blanks
	
	#return result
	return(varvalu)
}